#include "UIScene.h"
#include "DCHAR.h"
#include "SceneManager.h"

UIScene::UIScene()
{

}

UIScene::~UIScene()
{

}

bool UIScene::init()
{
	if (!CCLayer::init())
	{
		return false;
	}

	setTouchEnabled(true);

	SceneID_T sceneId = SceneManager::sharedSceneManager()->getCurrSceneId();
	char szFileName[_MAX_PATH] = "";
	dsprintfA(szFileName, sizeof(szFileName), "scene_%d.json", sceneId);
	CCNode * pNode = SceneReader::sharedSceneReader()->createNodeWithSceneFile(szFileName);
	this->addChild(pNode, 0, 1);

	return true;
}

CCScene * UIScene::scene()
{
	CCScene * pScene = CCScene::create();
	CCLayer * pLayer = UIScene::create();
	pScene->addChild(pLayer);
	return pScene;
}
